package com.pj.main;

import com.pj.util.Fwlib32;

public class Fwlib32Test {
    public static void main(String[] args) {
        // 调用 cnc_allclibhndl2 函数
        int[] hd = new int[123]; // 数组用于存储句柄
        int result = Fwlib32.fwlib.cnc_allclibhndl(hd, "hello", 2);

        if (result == 0) {
            System.out.println("cnc_allclibhndl2 成功调用，句柄：" + hd[123]);

            // 调用 cnc_alarm 函数
            int[] alm_no = new int[1];
            int[] alm_stat = new int[1];
            int alarmResult = Fwlib32.fwlib.cnc_alarm(hd[0], alm_no, alm_stat);

            if (alarmResult == 0) {
                System.out.println("cnc_alarm 成功调用，报警号：" + alm_no[0] + "，报警状态：" + alm_stat[0]);
            } else {
                System.out.println("调用 cnc_alarm 失败，错误码：" + alarmResult);
            }
        } else {
            System.out.println("调用 cnc_allclibhndl 失败，错误码：" + result);
        }
    }
}